//
//  ApiConstant+Login.m
//  bsl-sdk
//
//  Created by Fanty on 13-12-1.
//
//

#import "ApiConstant+Cube.h"
#import <chameleon-ios-sdk/Library/UIDevice+IdentifierAddition.h>

@implementation ApiConstant(Cube)

-(NSURL*)authURL:(NSString*)name{
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/mam/api/mam/clients/apps/%@/%@/auth?appKey=%@",self.serverURLHost,[[NSBundle mainBundle] bundleIdentifier],name,self.appKey]];
}


-(NSURL*)moduleListURL:(NSString*)token{
    
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/mam/api/mam/clients/apps/modules/%@",self.serverURLHost,token]];
    
    //return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/mam/api/mam/clients/ios/%@/%@/?username=%@&sessionKey=%@&timeStamp=%f",self.serverURLHost,[[NSBundle mainBundle] bundleIdentifier],[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"],username,sessionKey,[NSDate timeIntervalSinceReferenceDate]]];
    
    
}

-(NSURL*)snapshotURL:(NSString*)identifier version:(NSString*)version{
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/mam/api/mam/clients/widget/%@/%@/snapshot?appKey=%@",self.serverURLHost,identifier,version,self.appKey]];
}


-(NSURL*)messageListURL{
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/push/api/push-msgs/none-receipts/%@/%@",self.serverURLHost,[[UIDevice currentDevice] uniqueDeviceIdentifier],self.appKey]];
}

-(NSURL*)receptURL{
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/push/api/receipts",self.serverURLHost]];
}

-(NSURL*)messageByIdURL:(NSString*)messageId{
    
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/push/api/push-msgs/%@/%@",self.serverURLHost,self.appKey,messageId]];
    
    
}

-(NSURL*)loginURL{
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/system/api/system/mobile/accounts/login",self.serverURLHost]];
}

-(NSURL*)logoutURL{
    return [NSURL URLWithString:[NSString stringWithFormat:@"http://%@/system/api/system/mobile/accounts/logout",self.serverURLHost]];
}
@end

